package com.as.api;

import com.as.base.ResultBean;
import com.as.entity.Account;
import com.as.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 账单API
 *
 * @author YeJianFeng
 */
@RestController
@RequestMapping("/account")
@CrossOrigin
public class AccountApi {

    @Autowired
    private AccountService accountService;

    @GetMapping("/findAll")
    public ResultBean<List<Account>> findAll() {
        List<Account> accounts = accountService.queryAll();
        return new ResultBean<>(accounts);
    }
}
